package com.zy.pro.user.service;

import javax.servlet.http.HttpServletRequest;

import com.zy.core.service.BaseService;
import com.zy.pro.user.model.User;

public interface UserService extends BaseService<User> {

	/**
	 * 根据用户名密码查询状态(1:正常,2:冻结,4:待激活)的用户(3:删除的用户不查询)
	 * @param user
	 * @return
	 */
	User findUserNameAndPassword(User user);
	
	/**
	 * 注册用户,设置用户状态为4:待激活,并发送邮件到用户的注册邮箱,让用户激活帐号
	 * @param user
	 * @return
	 * @throws Exception
	 */
	String saveUser(User user, HttpServletRequest request) throws Exception;
	
	/**
	 * 根据邮箱和用户名查找用户(1:正常,2:冻结,4:待激活)的用户(3:删除的用户不查询)
	 * 用户名可以不输入(if判断了)
	 * @param user
	 * @return
	 */
	User findUserByEamilAndUserName(User user);
	
	/**
	 * 重置用户密码(123456),发送邮件告诉用户
	 * @param user
	 * @return
	 * @throws Exception
	 */
	String updateRsetPasswordAndToEmail(User user,HttpServletRequest request) throws Exception;
	
	/**
	 * 根据用户名查找用户(1:正常,2:冻结,4:未激活)不查询删除的3:删除
	 * @param user
	 * @return
	 */
	User findUserByUserName(User user);
}
